Skip to content

fix(#654, #655): i18n graceful fallback + staging E2E Playwright project#851

Open
oncleweynom wants to merge 1 commit into
solutions-plug:mainfrom
oncleweynom:fix/654-655-i18n-fallback-staging-e2e
Open

fix(#654, #655): i18n graceful fallback + staging E2E Playwright project#851
oncleweynom wants to merge 1 commit into
solutions-plug:mainfrom
oncleweynom:fix/654-655-i18n-fallback-staging-e2e

Conversation

@oncleweynom
Copy link
Copy Markdown

@oncleweynom oncleweynom commented May 30, 2026

Summary

Closes #654 and #655.

#654 — i18n locale detection graceful fallback

  • frontend/src/lib/i18n.ts — locale resolution chain: exact match → language subtag (e.g. pt from pt-BR) → en. t() always returns a string; missing keys warn in dev, are silent in prod.
  • frontend/I18N_GUIDE.md — documents resolution order, usage, adding locales, and key naming conventions.
  • frontend/src/lib/__tests__/i18n.test.ts — 16 unit tests covering all fallback scenarios.
    closes i18n locale detection does not fall back gracefully for unsupported locales #654

#655 — Playwright E2E against real staging API

  • frontend/playwright.config.ts — added staging project; activated when STAGING_URL env var is set. Local projects and webServer are suppressed in staging mode.
  • .github/workflows/e2e-staging.yml — triggers on push to main only (not PRs), runs --project=staging, reads STAGING_URL from GitHub secrets, uploads HTML report as artifact.

Testing

… staging E2E Playwright project

- Add src/lib/i18n.ts with locale resolution chain (exact → subtag → en),
  missing-key warn in dev / silent in prod, and registerTranslations helper
- Add frontend/I18N_GUIDE.md documenting the i18n approach
- Add src/lib/__tests__/i18n.test.ts covering all fallback scenarios
- Add 'staging' Playwright project activated via STAGING_URL env var
- Add .github/workflows/e2e-staging.yml that runs on merge to main only
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Playwright E2E tests do not run against a real API — all mocked i18n locale detection does not fall back gracefully for unsupported locales

1 participant